package com.example.kafka;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Project:spring-boot-kafka
 * <p>
 * Title:KafkaMessageController.java
 * <p>
 * Description:
 * <p>
 * Copyrigth:Jiang Software LTD.co Copyright (c) 2021
 * <p>
 * 
 * @version 1.0
 * @since 1.8
 * @author jiang
 * @history 2021 jiang create
 */

@Controller
public class KafkaController {

	@Autowired
	private MessageProducer kafkaMessageProducer;

	@RequestMapping(value = "/messageProducer")
	public String send(@RequestParam(value = "message", required = false, defaultValue = "上海欢迎您") String message) {
		kafkaMessageProducer.send("Kafka producer message : " + message);
		return "send";
	}

}
